package com.likou;

/**
 * Author: 陈桂明
 * Date: 2025/4/12 18:35
 * Description: q70
 */
public class q70 {
    public static void main(String[] args) {

    }

    public int climbStairs(int n) {
        if (n == 1 || n == 0) {
            return 1;
        }

        int ans = 0;
        int fx_1 = 1;
        int fx_2 = 1;

        for (int i = 0; i < n - 1; i++) {
            ans = fx_1 + fx_2;
            fx_1 = fx_2;
            fx_2 = ans;
        }

        return ans;
    }
}
